package json;

public class MIMEType {
	/**
	 * A MIME type is made up of 2 parts contentType/subtype
	 */
	protected String contentType;
	protected String subtype;

	public MIMEType(String type) {
		int slash = type.indexOf('/');
		contentType = type.substring(0, slash - 1);
		subtype = type.substring(slash + 1, type.length());
	}

	public MIMEType(String contentType, String subtype) {
		this.contentType = contentType;
		this.subtype = subtype;
	}

	public String toString() {
		return contentType + "/" + subtype;
	}

	public String getContentType() {
		return contentType;
	}

	public void setContentType(String contentType) {
		this.contentType = contentType;
	}

	public String getSubtype() {
		return subtype;
	}

	public void setSubtype(String subtype) {
		this.subtype = subtype;
	}
	
	
}
